//--></SCRIPT><META NAME="DESCRIPTION" CONTENT="Internet Information Services reference information">
<META HTTP-EQUIV="PICS-Label" CONTENT='(PICS-1.1 "<http://www.rsac.org/ratingsv01.html>" l comment "RSACi North America Server" by "inet@microsoft.com <mailto:inet@microsoft.com>" r (n 0 s 0 v 0 l 0))'>
<META NAME="MS.LOCALE" CONTENT="EN-US">
<META NAME="MS-IT-LOC" Content="Internet Information Services">
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H2><A NAME="_simple_query"></A><SUP> <% If Request("DontFrame")<>1 Then Response.Redirect "/iissamples/sdk/asp/docs/SampFram.asp?ovfile=/iishelp/iis/htm/asp/asps3unt.asp&srcfile=Database/SimpleQuery" %></SUP>Simple Query</H2>
<H6>Overview</H6>
<P>Although databases can be very complicated systems, and data access tools must be powerful and responsive, it is equally important that simple database access tasks be easy to accomplish. This sample demonstrates how ADO provides an easy way to perform such a task.</P>
<H6>Code Tour</H6>
<P>The goal of this sample application is to retrieve a small recordset from a Microsoft<sup>®</sup> Access database, and print the results. The first step is to create an instance of the <B>Connection</B> object, using the <B>Server.CreateObject</B> method. The sample uses the <B>Connection</B> object instance to open the OLE DB data provider, then uses the <B>Connection</B> instance again to execute a SQL <B>SELECT</B> command to retrieve all the records from the Authors table. The script finishes by iterating through the returned recordset collection and displaying the results. Afterwards, both the recordset and OLE DB data source connection are closed.</P>
<P><B><B>Important </B></B>OLE DB must be properly configured on the server for this sample to run properly. </P>